package com.kede.api.utils;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;

import java.time.LocalDateTime;

/**
 * @Author:Pr.li
 * @Date: create in 2023/7/9 17:25
 */
public class OrderUtil {

    public static String getRandomNo(String key){
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder
                .append(key)//不要改php的支付回调对这个开头的订单有处理
                .append(DateUtil.format(LocalDateTime.now(), "yyyyMMddHHmm"))
                .append(RandomUtil.randomNumbers(4));
        return stringBuilder.toString();
    }

}
